package com.hotel.customersystem.pojo;


import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.Table;
import javax.persistence.Transient;
import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * (CustomerUserCoupon)表实体类
 *
 * @author makejava
 * @since 2022-09-30 16:33:50
 */

@Data
@AllArgsConstructor
@NoArgsConstructor
@Table(name = "customer_user_coupon")
public class CustomerUserCoupon implements Serializable{

    // 序列化id
    private static final long serialVersionUID = 5163286331915428404L;

    //用户优惠券id
    @TableId
    private Integer couponId;
    //优惠券编号
    private String couponNo;
    //库存
    private Integer stock;
    //用户id
    private Integer userId;
    //领取时间
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime receiveTime;
    //失效时间
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime invalidTime;
    //优惠券使用状态
    private Integer couponUseStatus;
    //行锁
    private Integer version;
    //状态
    private Integer state;
    //创建时间
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;
    //更新时间
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;
    //用户账号
    private String standby01;
    //头像
    private String standby02;

    @Transient
    @TableField(exist = false)
    private String couponName;

    @Transient
    @TableField(exist = false)
    private Double couponPrice;

    @Transient
    @TableField(exist = false)
    private Double couponFullPrice;

    @Transient
    @TableField(exist = false)
    private Double couponDiscount;

    @Transient
    @TableField(exist = false)
    private LocalDate beginTime;

    @Transient
    @TableField(exist = false)
    private LocalDate endTime;
}

